package com.atguigu.flink.chapter05.Source;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * TODO 读文件
 *
 * @author cjp
 * @version 1.0
 * @date 2021/8/7 16:31
 */
public class Flink01_File {
    public static void main(String[] args) throws Exception {
        // 0. 执行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        // 1.读取数据: 可以读目录
        env
//                .readTextFile("F:\\atguigu\\01_course\\code\\flink210323\\input")
                .readTextFile("hdfs://hadoop1:8020/word.txt")
                .print();


        env.execute();


    }
}
